<script setup lang="ts">
import Wujie from 'wujie-vue3'
const wujieList = [
    {
        name: 'vue2',
        url: 'http://localhost:5002/',
        label: 'vue2项目',
        imgSrc: '',
        hidden: false,
    },
    {
        name: 'vue3',
        url: 'http://localhost:5003/',
        label: 'vue3项目',
        imgSrc: '',
        hidden: false,
    },
    {
        name: 'react',
        url: 'http://localhost:5004/',
        label: 'react项目',
        imgSrc: '',
        hidden: false,
    },
]
wujieList.forEach((item) => {
    const imgDom = document.createElement('img')
    imgDom.src = item.imgSrc || `${item.url}/wujie.svg`
    imgDom.onload = (event) => {
        console.log(event)
        item.hidden = false
    }
    imgDom.onerror = (event) => {
        console.log(event)
        item.hidden = true
    }
})
</script>

<template>
    <h2>无界微前端</h2>
    <Wujie
        v-for="item in wujieList"
        :key="item.name"
        :url="item.url"
        :name="item.name"
    ></Wujie>
</template>

<style scoped></style>
